package com.yelobblog.yelobblog.controller;

import com.yelobblog.yelobblog.common.untils.Response;
import com.yelobblog.yelobblog.domain.entity.qiniuBody;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import com.yelobblog.yelobblog.service.qiniuService;

@RestController
@RequestMapping("/qiniu")
public class qiniuController {
    @Resource
    private qiniuService qiniuService;

    @GetMapping("/uploadToken")
    public Response<String> uploadToken(@RequestParam String key) {
        return Response.success(qiniuService.uploadToken(key));
    }
    @PostMapping("/callback")
    public void callback(@RequestBody qiniuBody callbackBody) {
        qiniuService.callback(callbackBody);
    }
}
